package com.sky.mapper;


import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishFlavorMapper {


    /**
     * 批量插入口味数据
     * @param flavors
     */
    void insertBatch(List<DishFlavor> flavors);


    /**
     * 通过菜品id批量删除口味数据
     * @param ids
     */
    void deleteDishFlavorByIds(List<Long> ids);


    /**
     * 通过菜品ID查询对应口味
     * @param dishId
     * @return
     */
    @Select("select * from sky_take_out.dish_flavor where id = #{dishId}")
    List<DishFlavor> selectFlavorByDishId(Long dishId);


    /**
     * 通过菜品id删除口味信息
     * @param id
     */
    @Delete("delete sky_take_out.dish_flavor where id = #{id}")
    void deleteDishFlavorByDishId(Long id);
}
